<template>
  <div class="my">
    <div class="header">
      <p id="tt-my"><strong>我的</strong></p>

      <div class="personage">
        <img :src="src"/>
        <div class="tt-fd">
          <p>{{ uname }}</p>
          <span>{{ phone }}</span>
        </div>
        <p class="account">主账号</p>
        <span id="autonym"
          ><img src="../assets/icon/对的.svg" />已实名认证</span
        >
      </div>
      <!-- 钱包 订单 优惠卷 -->
      <div class="wallet">
        <ul>
          <li>0.00</li>
          <li><router-link to="/wallet">钱包</router-link></li>
        </ul>
        <span> |</span>
        <ul>
          <li>0</li>
          <li>订单</li>
        </ul>
        <span> |</span>
        <ul>
          <li>0</li>
          <li>优惠卷</li>
        </ul>
      </div>
      <!-- 会员开通 -->
      <div class="member">
        <div class="m-left">
          <img src="../assets/icon/会员.svg" alt="" />当前尚未开通~
          <p>极速出房 | 高效签约 | 便捷收租</p>
        </div>
        <button>立即开通</button>
      </div>
    </div>
    <section class="content">
      <ul>
        <li>
          <a href="https://www.eqiseo.com/">房源推广<span><img src="../assets/icon/向右箭头.svg" alt=""></span></a>
        </li>
        <li>合同管理<span><img src="../assets/icon/向右箭头.svg" alt=""></span></li>
        <router-link to="/buy"
          ><li>购买记录<span><img src="../assets/icon/向右箭头.svg" alt=""></span></li></router-link
        >
      </ul>
      <ul>
        <li>资讯<span><img src="../assets/icon/向右箭头.svg" alt=""></span></li>
      </ul>

      <ul>
        <li>
          <a href="https://appgallery.huawei.com/Featured"
            >去应用商店评分<span><img src="../assets/icon/向右箭头.svg" alt=""></span></a
          >
        </li>
        <router-link to="/opinion"
          ><li>意见与反馈<span><img src="../assets/icon/向右箭头.svg" alt=""></span></li></router-link
        >
      </ul>
      <ul>
        <router-link to="/about">
          <li>关于我们<span><img src="../assets/icon/向右箭头.svg" alt=""></span></li></router-link
        >
        <router-link to="/over">
          <li>设置<span><img src="../assets/icon/向右箭头.svg" alt=""></span></li></router-link
        >
      </ul>
    </section>
    <router-view />
  </div>
</template>
<script>
export default {
  data() {
    return {
      uname: "房东 1120213",
      phone: "",
      src:null
    };
  },
  created() {
    let message = JSON.parse(localStorage.getItem("message"));
    let user = JSON.parse(localStorage.getItem("user用户注册"));
    if (message) {
      this.uname = message.v1;
    } else {
      this.uname = user.uname;
    }
    if (message) {
      this.phone = message.v2;
    } else {
      this.phone = "无手机号码";
    }
    if( message){
      this.src= message.portrait
    }else{
      this.src= require("../assets/img/fd.jpeg")
    }
  },
};
</script>

<style lang="scss" scoped>
.my {
  width: 100%;
  .header {
    width: 100%;
    height: 200px;
    background-color: #6d9df1;
    border-bottom-left-radius: 10%;
    border-bottom-right-radius: 10%;
    color: white;
    font-size: 12px;
    #tt-my {
      margin: 0;
      text-align: center;
      padding-top: 5px;
    }
    strong {
      margin: 0;
      font-size: 18px;
      width: 100%;
    }
    .personage {
      display: flex;
      font-size: 14px;
      align-items: center;
      margin-top: 20px;
      img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        margin-left: 5px;
      }
      .tt-fd {
        font-size: 16px;
        margin-left: 10px;
        p {
          margin: 0;
        }
        span {
          font-size: 14px;
        }
      }
      .account {
        width: 60px;
        background-color: #fcde65;
        color: gray;
        text-align: center;
        line-height: 20px;
        border-radius: 5px;
        margin-top: -5px;
        margin-left: 10px;
      }
      #autonym {
        margin-left: 15%;
        margin-top: -15px;
        font-size: 12px;
        width: 25%;
        text-align: right;
        border: 1px solid #78f68e;
        border-top-left-radius: 20px;
        border-bottom-left-radius: 20px;
        color: #78f68e;
        padding: 2px 0;
        box-sizing: border-box;
        img {
          width: 10px;
          height: 10px;
          margin-right: 3px;
        }
      }
    }
    .wallet {
      width: 90%;
      display: flex;
      margin: 0 auto;
      justify-content: space-around;
      margin-top: 15px;
      a {
        color: white;
      }
      ul {
        width: 30%;
        text-align: center;
      }
      span {
        color: rgb(245, 230, 230);
        font-size: 13px;
        opacity: 0.5;
        margin-top: 7px;

      }
    }
    // 会员开通
    .member {
      height: 80px;
      width: 90%;
      margin: 10px auto;
      border-radius: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background-image: url(../assets/img/huiyuan1.jpeg);
      .m-left {
        margin-left: 10px;
        font-size: 12px;
        line-height: 100%;
        img {
          width: 30px;
        }
      }
      button {
        width: 80px;
        height: 27px;
        text-align: center;
        border-radius: 30px;
        margin-right: 10px;
        margin-top: -15px;
        border: 0;
        background-color: #d6a460;
        color: white;
      }
    }
  }
  .content {
    font-size: 16px;
    margin-top: 55px;
    width: 100%;
    // height: 500px;
    background-color: #f5f2f2;
    ul {
      width: 95%;
      margin-top: 5px;

      li {
        line-height: 40px;
        padding-left: 15px;
        width: 100%;
        height: 40px;
        background-color: white;
        border-bottom: 1px solid rgb(224, 220, 220);
        span {
          float: right;
          margin-right: 10px;
          img{
            width: 12px;
          }
        }
      }
    }
  }
}
</style>